package com.hp.define
/**
 * Created by hp4664 on 2018/1/26.
 */

public class FileType {
    public static final String JPG = "JPG"
    private static  Map<String, String> types = new HashMap<String, String>() {
        {
            this.put("JPG", ".jpg")
        }
    }

    public static String getSuffix(String key) {
        return (String)types.get(key)
    }

    public static String getSuffixByFilename(String filename) {
        return filename.substring(filename.lastIndexOf(".")).toLowerCase()
    }
}
